<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page import="com.infodms.dms.common.Constant"%>
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<%@page import="java.util.List"%>
<%
	String contextPath = request.getContextPath();
%>
<%@taglib uri="/jstl/cout" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>预授权审核查询</TITLE>
<SCRIPT LANGUAGE="JavaScript">
	var myPage;
	//查询路径
	var url = "<%=contextPath%>/repairOrder/RoMaintainMain/queryRepairOrderOEM.json";
				
	var title = null;

	var columns = [
					{header: "序号",sortable: false,align:'center',renderer:getIndex},
					{header: "经销商名称", width:'15%', dataIndex: 'dealerName'},
					{header: "车型", width:'15%', dataIndex: 'modelCode'},
					{header: "预授权申请单号", width:'15%', dataIndex: 'foNo'},
					{header: "工单号", width:'15%', dataIndex: 'roNo'},
					{header: "维修类型", width:'7%', dataIndex: 'approvalType',renderer:getItemValue},
					{header: "VIN", width:'15%', dataIndex: 'vin'},
					{header: "授权状态", width:'15%', dataIndex: 'reportStatus',renderer:getItemValue},
					{header:'授权人',width:'10%',dataIndex:'auditName'},
					{header:'审核时间',width:'10%',dataIndex:'updateDate',renderer:formatDate},
					{id:'action', width:'5%',header: "操作",sortable: false,dataIndex: 'id',renderer:myLink1,align:'center'}
		      ];
	//设置超链接  begin      
	function doInit()
	{
   		loadcalendar();
	}
	//行号加工单号
	function roLine(value,metadata,record) {
		return value+"-"+record.data.lineNo;
	}
	//单位代码渲染函数
	function dezero(value,metadata,record) {
		if (value==0){
			return "";
		}else {
			return value;
		}
	}
	//格式化时间为YYYY-MM-DD
	function formatDate(value,meta,record) {
		if (value==""||value==null) {
			return "";
		}else {
			return value.substr(0,10);
		}
	}
	//修改的超链接设置
	function myLink1(value,meta,record){

				return String.format("<a href=\"<%=contextPath%>/repairOrder/RoMaintainMain/roBalanceDetail1.do?type=1&roNo="+record.data.roNo+"&FID="
				+ value + "\">[明细]</a>");
	}
	//设置超链接
	function mySelect(value,meta,record){
  		return String.format(
         "<a href=\"#\" onclick='sel(\""+record.data.orderId+"\")'>"+ value +"</a>");

	}
	//具体操作
	function sel(){
		MyAlert("超链接！");
	}
	
	//取得已经选择的checkbox，拼接成字符串，各项目以,隔开
	function getCheckedToStr(name) {
		var str="";
		var chk = document.getElementsByName(name);
		if (chk==null){
			return "";
		}else {
		var l = chk.length;
		for(var i=0;i<l;i++){        
			if(chk[i].checked)
			{            
			str = chk[i].value+","+str; 
			}
		}
			return str;
		}
	}
	//上报
	function submitId(){
	var str=getCheckedToStr("orderIds");
		if (str!=""){
		MyConfirm("确认上报？",submitApply,[str]);
		}else {
			MyAlert("请选择至少一条要上报的申请单！");
		}
	}
	//上报操作
	function submitApply (str) {
		
			makeNomalFormCall('<%=request.getContextPath()%>/feedbackmng/apply/ServiceCarApply/servicecarapplySubmit.json?orderIds='+str,returnBack0,'fm','queryBtn');
		
	}
	//上报回调函数
	function returnBack0(json){
		var avl = json.returnValue;
		if(avl==1){
			__extQuery__(1);
			MyAlert("上报成功！");
		}else{
			MyAlert("上报失败！请联系管理员！");
		}
	}
	//删除
	function deleteId(){
	var str=getCheckedToStr("orderIds");
		if (str!=""){
		MyConfirm("确认删除？",deleteApply,[str]);
		}else {
			MyAlert("请选择至少一条要删除的申请单！");
		}
	}
	function deleteApply(str) {
		
			makeNomalFormCall('<%=request.getContextPath()%>/feedbackmng/apply/ServiceCarApply/servicecarapplyDelete.json?orderIds='+str,returnBack,'fm','queryBtn');
		
	}
	//删除回调函数
	function returnBack(json){
		var avl = json.returnValue;
		if(avl==1){
			__extQuery__(1);
			MyAlert("删除成功！");
		}else{
			MyAlert("删除失败！请联系管理员！");
		}
	}
	//回调函数
	function showResult(json){
		if(json.ACTION_RESULT == '1'){
			goBack();
			MyConfirm("新增成功！点击确认返回查询界面或者点击左边菜单进入其他功能！","window.location.href = '<%=request.getContextPath()%>/sysmng/orgmng/DlrInfoMng/queryAllDlrInfo.do'");
		}else if(json.ACTION_RESULT == '2'){
			MyAlert("新增失败！请重新载入或者联系系统管理员！");
		}
	}
	//返回
	function goBack(){
		window.location.href = "<%=request.getContextPath()%>/feedbackmng/apply/ServiceCarApply/servicecarapplyQuery.json";
	}


	function wapCle(){
	$('orgId').value='';
	$('orgCode').value='';
	}
	function clearInput(){
		$('dealerId').value='';
		$('dealerCode').value='';
	}
	function materCle(){
		$('materId').value='';
		$('materCode').value='';
	}
	//格式化时间为YYYY-MM-DD
	function formatDate(value,meta,record) {
		if (value==""||value==null) {
			return "";
		}else {
			return value.substr(0,10);
		}
	}
//设置超链接 end
</script>
</HEAD>
<BODY onload="doInit()">
<div class="navigation"><img src="../../img/nav.gif" />&nbsp;当前位置：售后服务系统&gt;索赔预授权&gt;预授权审核查询</div>
  <form method="post" name ="fm" id="fm">
    <TABLE  class="table_query">
          <tr>
            <td  class="table_query_2Col_label_7Letter">工单号：</td>
            <td><input name="RO_NO" id="RO_NO" value="" type="text" datatype="1,is_digit_letter,20" class="middle_txt" />
            </td>
            <td rowspan="2" class="table_query_2Col_label_7Letter" >VIN：</td>
 			<td rowspan="2"  align="left">
 			<!--  <input name="VIN" id="VIN" datatype="1,is_vin" type="text"  value="" class="middle_txt"/>-->
 			<textarea name="VIN" cols="18" rows="3" datatype="1,is_digit_letter"></textarea>
 			</td>
          </tr>
          <tr>
            <td  class="table_query_2Col_label_7Letter">维修类型：</td>
            <td >
            <script type="text/javascript">
	              genSelBoxExp("REPAIR_TYPE",<%=Constant.REPAIR_TYPE%>,"",true,"short_sel","","true",'');
	       	</script>
 		    </td> 	         
          </tr>    
          <tr>
          	<td class="table_query_2Col_label_7Letter">
          		授权状态：
          	</td>
          	<td >
          	  	<script type="text/javascript">
	              genSelBoxExp("RO_FORE",<%=Constant.RO_FORE%>,"",true,"short_sel","","true",'');
	        </script>
          	</td>
          </tr>
           <tr>
	          
	        <td align="right" nowrap class="table_query_2Col_label_7Letter" id="deId">选择经销商：</td>
	 		<td align="left" nowrap="true" id="deId1">
				<input class="middle_txt" id="dealerCode"  name="dealerCode" type="text"/>
				<input class="middle_txt" id="dealerId"  name="dealerId" type="hidden"/>
	            <input name="showBtn" type="button" class="mini_btn" style="cursor: pointer;" onClick="showOrgDealer('dealerCode','dealerId','false','',true);" value="..." />        
	            <input name="clrBtn" type="button" class="normal_btn" onClick="clearInput();" value="清除"/>  
			</td>
			  <td id="deId2" class="table_query_2Col_label_7Letter" align="right">区域：</td>
	       	  <td  id="deId3" align="left" nowrap="true" nowrap>
	          <input name="orgCode" class="middle_txt"  type="text" id="orgCode" size="40" value="" readonly/>
	          <input name="orgId" type="hidden" id="orgId" size="40" value="" />
			  <input name="orgSel" type="button" class="mini_btn" onClick="showOrg('orgCode' ,'orgId' ,false,'')" value="&hellip;" />
			  <input class="cssbutton" type="button" value="清空" onClick="wapCle();"/>
      	  </td>
          </tr>
          <tr>
          	<td class="table_query_2Col_label_7Letter">审核时间：</td>
			<td>
				 <input type="text" class="short_txt" name="approve_date" id="approve_date"  datatype="1,is_date,10" group="approve_date,approve_date2" hasbtn="true" callFunction="showcalendar(event, 'approve_date', false);"/>
                             至
                 <input type="text" class="short_txt" name="approve_date2" id="approve_date2"  datatype="1,is_date,10" group="approve_date,approve_date2" hasbtn="true" callFunction="showcalendar(event, 'approve_date2', false);"/>
           
			</td>
			<td class="table_query_2Col_label_7Letter">授权人：</td>
			<td>
				<input type="text" class="middle_txt" name="auditName"/>
			</td>
          </tr>
    	  <tr>
            <td colspan="4" align="center" nowrap>
            <input id="queryBtn" class="normal_btn" type="button" name="button" value="查询"  onClick="__extQuery__(1);" />
			</td>
            <td  align="right" ></td>
            </tr>
  </table>
	<!-- 查询条件 end -->
  <!--分页 begin -->
	<jsp:include page="${contextPath}/queryPage/orderHidden.html" />
	<jsp:include page="${contextPath}/queryPage/pageDiv.html" />
  <!--分页 end --> 
</form>
</BODY>
</html>